package org.infodavid.common.persistence;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.infodavid.common.pool.AbstractPooledFactory;
import org.infodavid.common.reflect.InstantiationHelper;

/**
 * A factory for creating objects.
 */
public abstract class QueryParameterFactory extends AbstractPooledFactory<IQueryParameter> {

	/** logger. */
	private static final Log LOGGER = LogFactory.getLog(QueryParameterFactory.class);

	/** The Constant singleton. */
	private static final QueryParameterFactory SINGLETON;

	static {
		try {
			SINGLETON = InstantiationHelper.getInstance().newInstance(QueryParameterFactory.class);
		}
		catch (final Exception e) {
			LOGGER.error("Can't instantiate a new " + QueryParameterFactory.class.getName(), e);

			throw new Error(e);
		}
	}

	/**
	 * returns the singleton.
	 * @return <code>PropertyChangeEventFactory</code>
	 */
	public static QueryParameterFactory getSingleton() {
		return SINGLETON;
	}

	/**
	 * The Constructor.
	 */
	protected QueryParameterFactory() {}
}
